package com.afalon.cloud.contracts.competition;

import java.net.URI;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

@PersistenceCapable
@XmlRootElement(name = "ladderplayer")
@XmlAccessorType(XmlAccessType.NONE)
public class LadderPlayer {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key ladderPlayerKey;
		
	@XmlElement(name="position")
	@Persistent
	private Integer position;
	
	@XmlElement(name="personid")
	@Persistent
	private String personId;
	
	@XmlElement(name="ladderid")
	@Persistent
	private String ladderId;
	
	@XmlElement(name="ladderplayeruri")
	public URI ladderPlayerUri;
	
	public LadderPlayer() 
	{
		
	}

	public Key getLadderPlayerKey() {
		return ladderPlayerKey;
	}
	
	@XmlElement(name="ladderplayerid")
	public String getLadderPlayerId() {
		return KeyFactory.keyToString(this.getLadderPlayerKey());
	}
		

	public void setPosition(Integer value) {
		this.position = value;
	}

	public Integer getPosition() {
		return this.position;
	}
	
	public void setPersonId(String value) {
		this.personId = value;
	}

	public String getPersonId() {
		return this.personId;
	}
	
	public void setLadderId(String value) {
		this.ladderId = value;
	}

	public String getLadderId() {
		return this.ladderId;
	}
	
}
